package com.ghpt.controller;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class demo {
    public static void main(String[] args) {
        String filePath = "C:\\Users\\17333\\Desktop\\SolarRadiation.csv"; // 文件路径，可按需修改，如 "D:/data/data.txt"
        try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath))) {
            for (int i = 1; i <= 8760; i++) {
                writer.write(String.valueOf(i));
                writer.newLine(); // 换行，实现每行一个数字
            }
            System.out.println("成功生成包含 8760 条数据的文件：" + filePath);
        } catch (IOException e) {
            System.out.println("生成文件时发生错误：" + e.getMessage());
        }
    }
}
